import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image } from '@tarojs/components'

import './head.scss'

class Head extends Component{
  render(){
    let {loginname, avatar} = this.props
    return(
      <View className='head-container'>
        <Image className='head-img' src={avatar ? avatar : require('../../assets/images/head.png')} />
        {
          loginname ? <Text className='head-name'>{loginname}</Text> : null
        }
      </View>
    )
  }
}

export default Head